package com.cjg.xiancheng;

public class lambdaTest {

    //正常
    public static void main(String[] args) {
        My my = new My();
        my.like0();
        new My1().like0();

        //局部内部类
         class  My2 implements  i{
            @Override
            public void like0() {
                System.out.println("My 3");
            }
        }
        new My2().like0();

         //匿名内部类
        new i() {

            @Override
            public void like0() {

                System.out.println("My 4");
            }
        }.like0();


        i can =new i() {
            @Override
            public void like0() {
                System.out.println("My 5");
            }
        };
        can.like0();

        i fuck = () -> {
            System.out.println("My 6");
        };
        fuck.like0();







    }

    //静态内部类
    static class  My1 implements  i{
        @Override
        public void like0() {
            System.out.println("My 2");
        }
    }


}

interface i{
    void like0();

}
class My implements  i{
    @Override
    public void like0() {
        System.out.println("My 1");
    }
}
